Skip to content

Conversation

simolus3
Copy link
Contributor

This exposes the new table options introduced in version 0.3.13 of the core extension, namely:

  • include_old (either a boolean or an array of column names): Adds an old entry to the ps_crud.data JSON object that includes old values for updates.
  • include_old_only_when_changed: Skip unchanged values from updates.
  • include_metadata: Adds a _metadata column that can be written to for updates. It's reported through CrudEntry.metadata afterwards.
  • ignore_empty_update: Don't create ps_crud entries for UPDATE statements that didn't change any values.

Most of this feature is tested in the core extension, this adds a few simple tests ensuring we forward options correctly.

@simolus3 simolus3 requested a review from stevensJourney April 28, 2025 14:52
@simolus3
Copy link
Contributor Author

cc @rkistner let me know what you think about the naming suggestions. I agree with them, but I'm not sure if we want a divergence between the JSON key internally and the public name? If that's ok I can apply the suggestion here and on the other PRs for this feature.

Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is pretty cool. I've left some minor naming comments, but I'm quite happy with the implementation.

@Radiokot
Copy link
Contributor

I'd love to have ignoreEmptyUpdates, thank you.

@rkistner
Copy link
Contributor

I like Steven's suggestions here.

It's fine if it diverges from the json, as long as it's consistent across the SDKs.

Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me 🚀

@simolus3 simolus3 merged commit cb37440 into main May 5, 2025
3 checks passed
@simolus3 simolus3 deleted the schema-options branch May 5, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants